Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🚨 [security] Update globalid: 0.4.2 → 1.0.1 (major) #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

depfu[bot]
Copy link
Contributor

@depfu depfu bot commented Jan 20, 2023


🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this update. Please take a good look at what changed and the test results before merging this pull request.

What changed?

↗️ globalid (indirect, 0.4.2 → 1.0.1) · Repo · Changelog

Security Advisories 🚨

🚨 ReDoS based DoS vulnerability in GlobalID

There is a ReDoS based DoS vulnerability in the GlobalID gem. This
vulnerability has been assigned the CVE identifier CVE-2023-22799.

Versions Affected: >= 0.2.1
Not affected: < 0.2.1
Fixed Versions: 1.0.1

Impact

There is a possible DoS vulnerability in the model name parsing section
of the GlobalID gem. Carefully crafted input can cause the regular
expression engine to take an unexpected amount of time. All users running
an affected release should either upgrade or use one of the workarounds
immediately.

Workarounds

There are no feasible workarounds for this issue.

Release Notes

1.0.1

Possible ReDoS based DoS vulnerability in GlobalID

There is a ReDoS based DoS vulnerability in the GlobalID gem. This
vulnerability has been assigned the CVE identifier CVE-2023-22799.

Versions Affected: >= 0.2.1
Not affected: NOTAFFECTED
Fixed Versions: 1.0.1

Impact

There is a possible DoS vulnerability in the model name parsing section of the
GlobalID gem. Carefully crafted input can cause the regular expression engine
to take an unexpected amount of time. All users running an affected release
should either upgrade or use one of the workarounds immediately.

Releases

The FIXED releases are available at the normal locations.

Workarounds

There are no feasible workarounds for this issue.

Credits

Thank you ooooooo_k for reporting this!

1.0.0

Stable API release.

The code is the same as the 0.6.0 release.

0.6.0

  • Add ActiveRecord::FixtureSet.signed_global_id helper to generate signed ids inside fixtures.

0.5.2

  • Add back Ruby 2.5 support so gem install rails works out of the box, thereby satisfying Rails' Ruby version requirement. See rails/rails#42931

0.5.1

  • New: Allow expiration to be turned off globally #128
  • Fixed: Support for ruby-head #132
  • Maintainance: Drop support for EOL'ed Rubies (< 2.6.0) and Rails 4.2

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ concurrent-ruby (indirect, 1.1.8 → 1.2.2) · Repo · Changelog

Release Notes

1.2.2

concurrent-ruby 1.2.2:

  • (#993) Fix arguments passed to Concurrent::Map's default_proc.

1.2.1

concurrent-ruby 1.2.1:

  • (#990) Add missing require 'fiber' for FiberLocalVar.
  • (#989) Optimize Concurrent::Map#[] on CRuby by letting the backing Hash handle the default_proc.

1.2.0

concurrent-ruby 1.2.0:

  • (#975) Set the Ruby compatibility version at 2.3
  • (#962) Fix ReentrantReadWriteLock to use the same granularity for locals as for Mutex it uses.
  • (#983) Add FiberLocalVar
  • (#934) concurrent-ruby now supports requiring individual classes (public classes listed in the docs), e.g., require 'concurrent/map'
  • (#976) Let Promises.any_fulfilled_future take an Event
  • Improve documentation of various classes
  • (#972) Remove Rubinius-related code

concurrent-ruby-edge 0.7.0:

  • (#975) Set the Ruby compatibility version at 2.3
  • (#934) concurrent-ruby now supports requiring individual classes (public classes listed in the docs), e.g., require 'concurrent/map'
  • (#972) Remove Rubinius-related code

1.1.10

concurrent-ruby:

  • (#951) Set the Ruby compatibility version at 2.2
  • (#939, #933) The caller_runs fallback policy no longer blocks reads from the job queue by worker threads
  • (#938, #761, #652) You can now explicitly prune_pool a thread pool (Sylvain Joyeux)
  • (#937, #757, #670) We switched the Yahoo stock API for demos to Alpha Vantage (Gustavo Caso)
  • (#932, #931) We changed how SafeTaskExecutor handles local jump errors (Aaron Jensen)
  • (#927) You can use keyword arguments in your initialize when using Async (Matt Larraz)
  • (#926, #639) We removed timeout from TimerTask because it wasn't sound, and now it's a no-op with a warning (Jacob Atzen)
  • (#919) If you double-lock a re-entrant read-write lock, we promote to locked for writing (zp yuan)
  • (#915) monotonic_time now accepts an optional unit parameter, as Ruby's clock_gettime (Jean Boussier)

1.1.9 (from changelog)

concurrent-ruby:

  • (#866) Child promise state not set to :pending immediately after #execute when parent has completed
  • (#905, #872) Fix RubyNonConcurrentPriorityQueue#delete method
  • (2df0337d) Make sure locks are not shared on shared when objects are dup/cloned
  • (#900, #906, #796, #847, #911) Fix Concurrent::Set tread-safety issues on CRuby
  • (#907) Add new ConcurrentMap backend for TruffleRuby

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ i18n (indirect, 1.8.10 → 1.12.0) · Repo · Changelog

Release Notes

1.12.0

What's Changed

  • Revert "Add support for CLDR data in I18n::Backend::Pluralization" by @radar in #633 -- this was causing breaking changes unintentionally.

Full Changelog: v1.11.0...v1.12.0

1.11.0

What's Changed

New Contributors

Full Changelog: v1.10.0...v1.11.0

1.10.0

What's Changed

New Features

Bug fixes

Other changes

  • Remove pry from Gemfile as it is not used by @dvzrv in #608

New Contributors

Full Changelog: v1.9.1...v1.10.0

1.9.1

What's Changed

Full Changelog: v1.9.0...v1.9.1

1.9.0

Minor version bump: The number of changes in this release are more than I would feel comfortable including in a point release. Therefore, I have bumped the minor version number here. -- @radar

What's Changed

New Contributors

Full Changelog: v1.8.11...v1.9.0

1.8.11

What's Changed

New Contributors

Full Changelog: v1.8.10...v1.8.11

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ minitest (indirect, 5.14.4 → 5.18.0) · Repo · Changelog

Release Notes

5.18.0 (from changelog)

  • 2 major enhancements:

    • Added assert_pattern & refute_pattern for pattern matching. (flavorjones)

    • Added matching must_pattern_match & wont_pattern_match to minitest/spec.

  • 1 bug fix:

    • Support the new message format of NameError in Ruby 3.3 (mame)

5.17.0 (from changelog)

  • 1 minor enhancement:

    • Refactor setup hooks into a SETUP_METHODS constant. (MSP-Greg)

  • 3 bug fixes:

    • Fix kwargs for Mock calls to delegator. (blowmage)

    • Fix kwargs for expectations. (bobmazanec, blowmage)

    • Remove check for .b method. (tenderlove)

5.16.3 (from changelog)

  • 2 bug fixes:

    • Fixed exception sanitization by removing TypeError restriction on rescue.

    • Use A instead of deprecated TESTOPTS in rake test:slow. (davidstosik)

5.16.2 (from changelog)

  • 4 bug fixes:

    • Added MT_KWARGS_HACK kludge for stub to deal with ruby 2.7 kwargs nastiness. (tsugimoto)

    • In #expect, pop Hash class from args if $MT_KWARGS_HACK. (casperisfine)

    • In above scenario, set expected kwargs (as Objects) based on actual kwargs.

    • Nuke ivars if exception fails to marshal twice (eg better_errors). (irphilli)

5.16.1 (from changelog)

  • 2 bug fixes:

    • Apparently adding real kwarg support to mocks/stubs broke some code. Fixed.

      • Use `MT_KWARGS_HACK=1` to activate the kludgy kwargs support w/ caveats.

    • Clarified some doco wrt the block on #stub.

5.16.0 (from changelog)

  • 2 major enhancements:

    • Added Minitest::TestTask.

    • Dropping ruby 2.2 - 2.5. 2.6 is DTM soon too.

  • 11 minor enhancements:

    • Added –show-skips option to show skips at end of run but not require –verbose. (MSP-Greg)

    • Added Minitest.seed, the random seed used by the run.

    • Calling `srand Minitest.seed` before all shuffles to ensure determinism.

    • Extended #stub to handle kwargs for both block and call args. (SampsonCrowley)

    • Extended Mock#__call to display kwargs.

    • Extended Mock#expect to record kwargs.

    • Extended Mock#method_missing to take kwargs & compare them against expected.

    • Mock#method_missing displays better errors on arity mismatch.

    • Removed minor optimization removing empty suites before run.

    • Simplified test randomization (test order will change even with fixed seed).

    • assert_match now returns the MatchData on success. (Nakilon)

  • 3 bug fixes:

    • (Re)Fixed marshalling of exceptions, neutering them in 2 passes.

    • Fixed more problems with rdoc.

    • Had to patch up mock and stub to deal with <=2.7 kwargs oddities

5.15.0 (from changelog)

  • 1 major enhancement:

    • assert_throws returns the value returned, if any. (volmer)

  • 3 minor enhancements:

    • Added -S <CODES> option to skip reporting of certain types of output

    • Enable Ruby deprecation warnings by default. (casperisfine)

    • Use Etc.nprocessors by default in order to maximize cpu usage. (tonytonyjan)

  • 6 bug fixes:

    • Close then unlink tempfiles on Windows. (nobu)

    • Fixed #skip_until for windows paths. (MSP-Greg)

    • Fixed a bunch of tests for jruby and windows. (MSP-Greg)

    • Fixed marshalling of specs if they error. (tenderlove, jeremyevans, et al)

    • Updated deprecation message for block expectations. (blowmage)

    • Use Kernel.warn directly in expectations in case CUT defines their own warn. (firien)

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ tzinfo (indirect, 2.0.4 → 2.0.6) · Repo · Changelog

Release Notes

2.0.6

  • Eliminate Object#untaint deprecation warnings on JRuby 9.4.0.0. #145.

TZInfo v2.0.6 on RubyGems.org

2.0.5

  • Changed DateTime results to always use the proleptic Gregorian calendar. This affects DateTime results prior to 1582-10-15 and any arithmetic performed on the results that would produce a secondary result prior to 1582-10-15.
  • Added support for eager loading all the time zone and country data by calling either TZInfo::DataSource#eager_load! or TZInfo.eager_load!. Compatible with Ruby On Rails' eager_load_namespaces. #129.
  • Ignore the SECURITY file from Arch Linux's tzdata package. #134.

TZInfo v2.0.5 on RubyGems.org

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.

↗️ zeitwerk (indirect, 2.4.2 → 2.6.7) · Repo · Changelog

Release Notes

2.6.7 (from changelog)

  • Reset module state on Zeitwerk::NameError.

    If an autoload is triggered, the file is loaded successfully, but the expected constant does not get defined, Ruby resets the state of the module. In particular, autoload? returns nil for that constant name, and constants does not include the constant name (starting with Ruby 3.1).

    Zeitwerk is more strict, not defining the expected constant is an error condition and the loader raises Zeitwerk::NameError. But this happens during the require call and the exception prevents Ruby from doing that cleanup.

    With this change, the parent module is left in a state that makes more sense and is consistent with what Ruby does.

  • A message is logged if an autoload did not define the expected constant.

    When that happens, Zeitwerk::NameError is raised and you normally see the exception. But if the error is shallowed, and you are inspecting the logs to investigate something, this new message may be helpful.

  • By default, Zeitwerk::Loader#dirs filters ignored root directories out. Please, pass ignored: true if you want them included.

    It is very strange to configure a root directory and also ignore it, the edge case is supported only for completeness. However, in that case, client code listing root directories rarely needs the ignored ones.

  • Documentation improvements.

  • Enforcement of private interfaces continues with another gradual patch.

2.6.6 (from changelog)

  • The new eager_load_namespace had a bug when eager loading certain namespaces with collapsed directories. This has been fixed.

2.6.5 (from changelog)

  • Controlled errors in a couple of situations:

    • Attempting to eager load or reload without previously invoking setup now raises Zeitwerk::SetupRequired.

    • The method Zeitwerk::Loader#push_dir raises Zeitwerk::Error if it gets an anonymous custom namespace.

    These should be backwards compatible, because they raise in circumstances that didn't work anyway. The goal here is to provide a meaningful error upfront.

  • Enforcement of private interfaces continues with another gradual patch.

2.6.4 (from changelog)

Ruby does not have gem-level visibility, so sometimes you need things to be public for them to be accessible internally. But they do not belong to the public interface of the gem.

A method that is undocumented and marked as @private in the source code is clearly private API, regardless of its formal Ruby visibility.

This release starts a series of gradual patches in which private interface is enforced with stricter formal visibility.

2.6.3 (from changelog)

  • v2.6.2 introduced a regression in the logic that checks whether two loaders want to manage the same root directories. It has been fixed.

2.6.2 (from changelog)

  • Zeitwerk::Loader#load_file allows you to load an individual Ruby file. Check its documentation for details.

  • Zeitwerk::Loader#eager_load_dir allows you to eager load a directory, recursively. Check its documentation for details.

  • Zeitwerk::Loader#eager_load_namespace allows you to eager a namespace, recursively. Namespaces are global, this method loads only what the receiver manages from that namespace, if anything. Check its documentation for details.

  • Zeitwerk::Loader.eager_load_namespace broadcasts eager_load_namespace to all registered loaders. Check its documentation for details.

  • Documents shadowed files. They always existed, but were not covered by the documentation.

  • Other assorted documentation improvements.

2.6.1 (from changelog)

  • Zeitwerk::Loader#dirs allows you to instrospect the root directories configured in the receiver. Please check its documentation for details.

2.6.0 (from changelog)

  • Directories are processed in lexicographic order.

    Different file systems may list directories in different order, and with this change we ensure that client code eager loads consistently across platforms, for example.

  • Before this release, subdirectories of root directories always represented namespaces (unless ignored or collapsed). From now on, to be considered namespaces they also have to contain at least one non-ignored Ruby file with extension .rb, directly or recursively.

    If you know beforehand a certain directory or directory pattern does not represent a namespace, it is intentional and more efficient to tell Zeitwerk to ignore it.

    However, if you don't do so and have a directory tasks that only contains Rake files, arguably that directory is not meant to represent a Ruby module. Before, Zeitwerk would define a top-level Tasks module after it; now, it does not.

    This feature is also handy for projects that have directories with auxiliary resources mixed in the project tree in a way that is too dynamic for an ignore pattern to be practical. See #216.

    In the unlikely case that an existing project has an empty directory for the sole purpose of defining a totally empty module (no code, and no nested classes or modules), such module has now to be defined in a file.

    Directories are scanned again on reloads.

  • On setup, loaders created with Zeitwerk::Loader.for_gem issue warnings if lib has extra, non-ignored Ruby files or directories.

    This is motivated by existing gems with directories under lib that are not meant to define Ruby modules, like directories for Rails generators, for instance.

    This warning can be silenced in the unlikely case that the extra stuff is actually autoloadable and has to be managed by Zeitwerk.

    Please, check the documentation for further details.

    This method returns an instance of a private subclass of Zeitwerk::Loader now, but you cannot rely on the type, just on the interface.

2.5.4 (from changelog)

  • If a file did not define the expected constant, there was a reload, and there were on_unload callbacks, Zeitwerk still tried to access the constant during reload, which raised. This has been corrected.

2.5.3 (from changelog)

  • The change introduced in 2.5.2 implied a performance regression that was particularly dramatic in Ruby 3.1. We'll address #198 in a different way.

2.5.1 (from changelog)

  • Restores support for namespaces that are not hashable. For example namespaces that override the hash method with a different arity as shown in #188.

2.5.0 (from changelog)

Breaking changes

  • Requires Ruby 2.5.

  • Deletes the long time deprecated preload API. Instead of:

    loader.preload("app/models/user.rb")

    just reference the constant on setup:

    loader.on_setup { User }

    If you want to eager load a namespace, use the constants API:

    loader.on_setup do
      Admin.constants(false).each { |cname| Admin.const_get(cname) }
    end

Bug fixes

  • Fixes a bug in which a certain valid combination of overlapping trees managed by different loaders and ignored directories was mistakenly reported as having conflicting directories.

  • Detects external namespaces defined with Module#autoload. If your project reopens a 3rd party namespace, Zeitwerk already detected it and did not consider the namespace to be managed by the loader (automatically descends, ignored for reloads, etc.). However, the loader did not do that if the namespace had only an autoload in the 3rd party code yet to be executed. Now it does.

Callbacks

  • Implements Zeitwerk::Loader#on_setup, which allows you to configure blocks of code to be executed on setup and on each reload. When the callback is fired, the loader is ready, you can refer to project constants in the block.

    See the documentation for further details.

  • There is a new catch-all Zeitwerk::Loader#on_load that takes no argument and is triggered for all loaded objects:

    loader.on_load do |cpath, value, abspath|
      # ...
    end

    Please, remember that if you want to trace the activity of a loader, Zeitwerk::Loader#log! logs plenty of information.

    See the documentation for further details.

  • The block of the existing Zeitwerk::Loader#on_load receives also the value stored in the constant, and the absolute path to its corresponding file or directory:

    loader.on_load("Service::NotificationsGateway") do |klass, abspath|
      # ...
    end

    Remember that blocks can be defined to take less arguments than passed. So this change is backwards compatible. If you had

    loader.on_load("Service::NotificationsGateway") do
      Service::NotificationsGateway.endpoint = ...
    end

    That works.

  • Implements Zeitwerk::Loader#on_unload, which allows you to configure blocks of code to be executed before a certain class or module gets unloaded:

    loader.on_unload("Country") do |klass, _abspath|
      klass.clear_cache
    end

    These callbacks are invoked during unloading, which happens in an unspecified order. Therefore, they should not refer to reloadable constants.

    You can also be called for all unloaded objects:

    loader.on_unload do |cpath, value, abspath|
      # ...
    end

    Please, remember that if you want to trace the activity of a loader, Zeitwerk::Loader#log! logs plenty of information.

    See the documentation for further details.

Assorted

  • Performance improvements.

  • Documentation improvements.

  • The method Zeitwerk::Loader#eager_load accepts a force flag:

    loader.eager_load(force: true)

    If passed, eager load exclusions configured with do_not_eager_load are not honoured (but ignored files and directories are).

    This may be handy for test suites that eager load in order to ensure all files define the expected constant.

  • Eliminates internal use of File.realpath. One visible consequence is that in logs root dirs are shown as configured if they contain symlinks.

  • When an autoloaded file does not define the expected constant, Ruby clears state differently starting with Ruby 3.1. Unloading has been revised to be compatible with both behaviours.

  • Logging prints a few new traces.

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Jan 20, 2023
@depfu depfu bot force-pushed the depfu/update/globalid-1.0.1 branch from dd5794c to 9ae45bf Compare April 12, 2023 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants